<?php

declare(strict_types=1);
/**
 * This file is part of habo_new_media.
 *
 * @link     https://www.berlen.cn/
 * @contact  tech@berlen.cn
 * @license  http://gitlab.rehou.cn/habo/habo_new_media/-/blob/master/README.md
 */

namespace app\service\batch\kuaishou;

use app\model\KsActionBarModel;
use app\service\fetch\MediaInterface;
use app\service\fetch\MediaService;

class ActionSyncService extends MediaService implements MediaInterface
{

    /**
     * 同步快手行动号.
     * @param string $advertiserId 账户主id
     * @param int $version 版本号日期
     * @return bool
     */
    public static function syncAction(string $advertiserId = '', int $version = 0): bool
    {
        KsActionBarModel::where('advertiser_id', $advertiserId)->where('version', '<', $version)->delete();
        return true;
    }
}
